/*
  class
    -静态成员 static
    -集成 extends
*/

// function Person(name) {
//   this.name = name;
// }

// Person.prototype.say = function () {
//   console.log(this.name);
// };
class Person {
  constructor(name) {
    this.name = name;
  }
  say() {
    console.log(this.name);
  }
  static create(name) {
    //this指向类型
    //类本身调用
    return new Person(name);
  }
}
// const p = new Person("caozy");
// p.say();
// let p2 = Person.create("zy");
// p2.name;

class Student extends Person {
  constructor(name, number) {
    super(name);
    this.number = number;
  }
  hello() {
    super.say();
    console.log(this.number);
  }
}
let s = new Student("zy", 1991);
s.hello();
